<!--
  -    Copyright (c) 2018-2025, lengleng All rights reserved.
  -
  - Redistribution and use in source and binary forms, with or without
  - modification, are permitted provided that the following conditions are met:
  -
  - Redistributions of source code must retain the above copyright notice,
  - this list of conditions and the following disclaimer.
  - Redistributions in binary form must reproduce the above copyright
  - notice, this list of conditions and the following disclaimer in the
  - documentation and/or other materials provided with the distribution.
  - Neither the name of the pig4cloud.com developer nor the names of its
  - contributors may be used to endorse or promote products derived from
  - this software without specific prior written permission.
  - Author: lengleng (wangiegie@gmail.com)
  -->

<template>
  <div class="app-container calendar-list-container">
    <div>
      <span class="title" style="margin-left: 30px;">基本信息:</span>
    </div>
    <el-col :span="24" style='margin-top:15px;'>
      <el-form :label-position="labelPosition" label-width="120px" :rules="rules" :model="form" ref="form">
        <el-form-item label="商品名称:" prop="goodsName">
          <el-input v-model="form.goodsName" placeholder="请输入商品标题（0/40）" class="inputRow"></el-input>
        </el-form-item>
        <el-form-item label="主图:" prop="topPicture">
          <el-upload class="avatar-uploader" action="/app/sys/oss/upload"  :show-file-list="false" :on-success="handleAvatarSuccess">
            <img v-if="form.topPicture" :src="form.topPicture" class="avatars">
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-form-item>
        <el-form-item label="商品价格:" prop="price">
          <el-input v-model="form.price"  placeholder="请输入商品价格" class="inputRow"></el-input>
        </el-form-item>
        <el-form-item label="折扣价格:" prop="discountPrice">
          <el-input v-model="form.discountPrice"  placeholder="请输入折扣价格" class="inputRow"></el-input>
        </el-form-item>
        <el-form-item label="商品数量单位:" prop="priceUnit">
          <el-select v-model="form.priceUnit"  placeholder="请选择" >
            <el-option
              v-for="item in priceUnitList"
              :key="item.value"
              :label="item.description"
              :value="item.description">
            </el-option>
          </el-select>
        </el-form-item>
        <span class="call">货币单位平台默认为人民币￥(元)</span>
        <el-form-item label="商品库存:" prop="inventory">
          <el-input v-model="form.inventory"  placeholder="请输入商品库存" class="inputRow"></el-input>
        </el-form-item>
        <el-form-item label="商品类目:" prop="atype">
          <el-select v-model="form.atype" placeholder="请选择" @change="changeGoodLeiMu(form.atype)">
            <el-option
              v-for="item in GoodLeiMuList"
              :key="item.id"
              :label="item.value"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="布料类型:" prop="btype" v-if="mianliaoShow" >
          <el-select v-model="form.btype" placeholder="请选择" @change="changeBuLiaoLeiMu(form.btype)">
            <el-option
              v-for="item in buLiaoList"
              :key="item.id"
              :label="item.value"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="商品子类目:" prop="zileimuType">
          <el-select v-model="zileimuType" placeholder="请选择" @change="changeShangPinZiLeiMu(zileimuType)">
            <el-option
              v-for="item in childrenTypeList"
              :key="item.id"
              :label="item.value"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="工厂地址:" prop="address" v-if="gongChangDiZhiShow">
          <el-input v-model="form.address"  placeholder="请输入工厂地址" class="inputRow"></el-input>
        </el-form-item>
        <div>
          <span class="title">参数详情:</span>
        </div>
        <el-form-item label="商品货号:" prop="artNo">
          <el-input v-model="form.artNo" placeholder="请输入商品货号" class="inputRow"></el-input>
        </el-form-item>
        <el-form-item label="编织工艺:" prop="weaveProcess" v-if="bianzhiShow">
          <el-radio v-model="form.weaveProcess"  label="1">经编</el-radio>
          <el-radio v-model="form.weaveProcess" label="2">纬编</el-radio>
        </el-form-item>
        <el-form-item label="商品分类:" prop="goodsCType">
          <el-select v-model="form.goodsCType" placeholder="请选择商品分类">
            <el-option
              v-for="item in shangPinFenLeiList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="商品类别:" prop="goodsDType" v-if="leibieShow">

          <el-select v-model="form.goodsDType" placeholder="请选择商品类别">
            <el-option
              v-for="item in shangpinLieBieList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="商品色系:" prop="color" v-if="yanseShow">
          <el-select v-model="form.color" placeholder="请选择颜色">
            <el-option
              v-for="item in colorList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="拉头工艺:" prop="sliderProcess" v-if="latouShow">
          <el-input v-model="form.sliderProcess"  placeholder="请输入拉头工艺（如：电镀、挂漆）" class="inputRow"></el-input>
        </el-form-item>
        <el-form-item label="生产工艺:" prop="productionProcess" v-if="shengchanShow">
          <el-input v-model="form.productionProcess"  placeholder="请输入生产工艺（如:压膜）" class="inputRow"></el-input>
        </el-form-item>
        <el-form-item label="潘通色号:" prop="pantoneNum" v-if="pantongShow">
          <el-input v-model="form.pantoneNum" placeholder="请输入潘通色号" class="inputRow"></el-input>
        </el-form-item>
        <el-form-item label="克重:" prop="weight" v-if="kezhongShow">
          <el-input v-model="form.weight" placeholder="请输入克重"></el-input>
        </el-form-item>
        <el-form-item label="幅宽(cm):"  prop="breadth" v-if="fukuanShow">
          <el-input v-model="form.breadth" placeholder="请输入幅宽"></el-input>
        </el-form-item>
        <el-form-item label="原料纱支:"   prop="rawYarn" v-if="yuanliaoShow">
          <el-select v-model="form.rawYarn" placeholder="请选择原料纱支" @change="chooseRawYarn(form.rawYarn)">
            <el-option
              v-for="item in yuanliaoList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="其他原料纱支:"   prop="componentProportion" v-if="qitaRawYarn">
          <el-input v-model="form.otherRawYarn"  placeholder="请输入成本比例"></el-input>
        </el-form-item>
        <el-form-item label="成份比例:"   prop="componentProportion" v-if="chengbenShow">
          <el-input v-model="form.componentProportion"  placeholder="请输入成份比例"></el-input>
        </el-form-item>
        <el-form-item label="光泽度:"   prop="glossiness" v-if="guangzeShow">
          <el-select v-model="form.glossiness" placeholder="请选择光泽度">
            <el-option
              v-for="item in guangzeduList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="花型尺寸:"   prop="flowerSize" v-if="huaxingShow">
          <el-input v-model="form.flowerSize"  placeholder="请输入花型尺寸"></el-input>
        </el-form-item>
        <el-form-item label="宽度:"  prop="width" v-if="kuanduShow">
          <el-input v-model="form.width" placeholder="请输入宽度"></el-input>
        </el-form-item>
        <el-form-item label="厚度:"   prop="thickness" v-if="houduShow">
          <el-input v-model="form.thickness" placeholder="请输入厚度"></el-input>
        </el-form-item>
        <el-form-item label="含胶量:"   prop="rubberContent" v-if="hanjiaoShow">
          <el-input v-model="form.rubberContent"  placeholder="请输入含胶量"></el-input>
        </el-form-item>
        <el-form-item label="其他参数:" v-if="qitaShow">
          <el-input v-model="form.otherParam"  placeholder="请输入其他参数"></el-input>
        </el-form-item>
        <el-form-item label="材质:"  prop="material" v-if="caizhiShow">
          <el-select v-model="form.material" placeholder="请选择材质">
            <el-option
              v-for="item in fuliaocaizhiList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="弹力程度:"   prop="elasticDegree" v-if="tanliShow">
          <el-select v-model="form.elasticDegree" placeholder="请选择弹力程度">
            <el-option
              v-for="item in tanliList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="花高:"   prop="flowerHigh" v-if="huagaoShow">
          <el-input v-model="form.flowerHigh"  placeholder="请输入花高"></el-input>
        </el-form-item>
        <!--<el-form-item label="重量"   prop="component">-->
          <!--<el-input v-model="form.parameter"  placeholder="请输入重量"></el-input>-->
        <!--</el-form-item>-->
        <el-form-item label="宽度分类:"   prop="widthClass" v-if="kuandufenleiShow">
          <el-select v-model="form.widthClass" placeholder="请选择宽度分类">
            <el-option
              v-for="item in kuandufeneleiList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="尺寸:"   prop="zipperType" v-if="chicunShow">
          <el-input v-model="form.zipperType" placeholder="请输入尺寸（3#，5#）"></el-input>
        </el-form-item>
        <el-form-item label="规格型号:"   prop="specificationModel" v-if="xinghaoShow">
          <el-input v-model="form.specificationModel" placeholder="请输入规格型号"></el-input>
        </el-form-item>
        <el-form-item label="杯型厚度:"   prop="cupThickness" v-if="beixingShow">
          <el-select v-model="form.cupThickness" placeholder="请选择杯型厚度">
            <el-option
              v-for="item in beixingList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="贴布材质:"   prop="patchMaterial" v-if="tiebuShow">
          <el-input v-model="form.patchMaterial" placeholder="请输入贴布材质"></el-input>
        </el-form-item>
        <el-form-item label="规格尺寸:"   prop="size" v-if="guigecicunShow">
          <el-input v-model="form.size" placeholder="请输入规格尺寸"></el-input>
        </el-form-item>
        <el-form-item label="包装材质:"   prop="wrapperMaterial" v-if="baozhuangShow">
          <el-select v-model="form.wrapperMaterial" placeholder="请选择杯型厚度">
            <el-option
              v-for="item in baozhuangList"
              :key="item.value"
              :label="item.description"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="现货情况:"   prop="buyType">
          <el-radio v-model="form.buyType"  label="1">现货</el-radio>
          <el-radio v-model="form.buyType" label="2">定制</el-radio>
        </el-form-item>
        <el-form-item label="描述信息:">
          <el-input style="width: 50%;" v-model="form.describeInfo" type="textarea" resize="none" rows="5" placeholder="描述信息" class="inputRow"></el-input>
        </el-form-item>
        <div>
          <span class="title">特别说明:</span>
        </div>
        <!--<el-input-->
          <!--type="textarea"-->
          <!--placeholder="请输入内容"-->
          <!--v-model="textarea2"  style="width: 70%;" :rows="7" resize="none">-->
        <el-form-item  >
          <div class="detailContent">
            <span class="specialText">1、商品价格受原材料和市场趋势影响，最终成交价格以买卖双方确认后的价格为准；</span>
            <span class="specialText">2、图片与实际颜色会有误差，以收到货物的实际颜色为准；</span>
            <span class="specialText">3、门幅和克重在指定范围内会有差异；</span>
          </div>
        </el-form-item>
        <div>
          <span style="color:red">*</span>
          <span class="title">图片信息:</span>
        </div>
        <div>
          <el-upload
            action="/app/sys/oss/upload"
            list-type="picture-card"
            :file-list="pictureList"
            :multiple="true"
            :limit="8"
            :on-success="handleUploadSuccess"
            :on-remove="handleRemove"
            :on-preview="handlePictureCardPreview">
            <i class="el-icon-plus"></i>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="">
          </el-dialog>
        </div>
        <div style="margin-top: 15px;">
          <el-button type="success" @click="publishGood">确认发布</el-button>
          <!--<span class="publisBtn">确认发布</span>-->
        </div>
      </el-form>
    </el-col>
  </div>
</template>

<script>
  import { mapState } from 'vuex'
  import { queryShangPinLeiMu, queryShangPinFenLei, publishGood } from '@/api/goods'
  import { getUserId } from '@/api/user'
  // import { uploadUrl } from '@/config/env'
  export default {
    components: {
    },
    name: 'seller_index',
    directives: {
    },
    data() {
      return {
        userId: '', // userId
        pictureList: [], // 图片列表
        radio: '1', // 单选
        radio1: '1', // 现货情况
        dialogImageUrl: '',
        dialogVisible: false,
        textarea2: '',
        defaultProps: {
          children: 'children',
          label: 'name'
        },
        labelPosition: 'right',
        form: {
          describeInfo: '',
          goodsName: '',
          goodsNo: '',
          topPicture: '',
          price: '',
          discountPrice: '',
          describe: '',
          address: '',
          priceUnit: '',
          inventory: '',
          atype: '',
          btype: '',
          ctype: '',
          artNo: '',
          color: '',
          otherRawYarn: '',
          zileimuType: '',
          // parameter: {
          goodsCType: '',
          goodsDType: '',
          weight: '',
          componentProportion: '',
          flowerSize: '',
          width: '',
          size: '',
          patchMaterial: '',
          weaveProcess: '1',
          pantoneNum: '',
          breadth: '',
          rubberContent: '',
          thickness: '',
          otherParam: '',
          flowerHigh: '',
          sliderProcess: '',
          specificationModel: '',
          productionProcess: '',
          glossiness: '',
          cupThickness: '',
          zipperType: '',
          material: '',
          widthClass: '',
          buyType: '1',
          rawYarn: '',
          elasticDegree: '',
          wrapperMaterial: ''
          // }
        },
        GoodLeiMuList: [], // 商品类目列表
        buLiaoList: [], // 面料列表
        childrenTypeList: [], // 商品子类目
        shangPinFenLeiList: [], // 商品分类
        shangpinLieBieList: [], // 商品类别
        colorList: [], // 颜色列表
        yuanliaoList: [], // 原料纱支
        guangzeduList: [], // 关泽度
        fuliaocaizhiList: [], // 辅料材质
        tanliList: [], // 弹力程度
        kuandufeneleiList: [], // 宽度分类
        beixingList: [], // 杯型厚度
        baozhuangList: [], // 包装材质
        priceUnitList: [], // 价格单位列表
        zileimuType: '', // 子类目type
        mianliaoShow: false, // 面料展示
        gongChangDiZhiShow: false, // 工厂地址展示
        baozhuangShow: true, // 包装材质
        guigecicunShow: true, // 规格尺寸
        tiebuShow: true, // 贴布材质
        beixingShow: true, // 杯型厚度
        xinghaoShow: true, // 规格型号
        chicunShow: true, // 杯型厚度
        kuandufenleiShow: true, // 宽度分类
        huagaoShow: true, // 花高
        tanliShow: true, // 弹力
        caizhiShow: true, // 材质
        qitaShow: true, // 其他参数
        hanjiaoShow: true, // 含胶量
        houduShow: true, // 厚度
        kuanduShow: true, // 宽度
        huaxingShow: true, // 花型尺寸
        guangzeShow: true, // 光泽
        chengbenShow: true, // 成分比例
        yuanliaoShow: true, // 原料纱支
        fukuanShow: true, // 幅宽
        kezhongShow: true, // 克重
        pantongShow: true, // 潘通色号
        shengchanShow: true, // 生产工艺
        latouShow: true, // 拉头工艺
        bianzhiShow: true, // 编织工艺
        yanseShow: true, // 颜色
        leibieShow: true, // 类别
        qitaRawYarn: false, // 其他原料纱支
        value: '请选择',
        // 规格约束
        rules: {
          goodsName: [
            {
              required: true,
              message: '商品名称没填',
              trigger: 'blur'
            },
            {
              min: 1,
              max: 40,
              message: '长度在 1 到 40 个字符',
              trigger: 'blur'
            }
          ],
          topPicture: [
            {
              required: true,
              message: '请上传商品主图',
              trigger: 'blur'
            }
          ],
          price: [
            {
              required: true,
              message: '商品价格没填',
              trigger: 'blur'
            }
          ],
          discountPrice: [
            {
              required: true,
              message: '商品折扣价没填',
              trigger: 'blur'
            }
          ],
          priceUnit: [
            {
              required: true,
              message: '商品数量单位没填',
              trigger: 'blur'
            }
          ],
          inventory: [
            {
              required: true,
              message: '库存没填',
              trigger: 'blur'
            }
          ],
          atype: [
            {
              required: true,
              message: '商品类目没选择',
              trigger: 'blur'
            }
          ],
          btype: [
            {
              required: true,
              message: '面料类型没选择',
              trigger: 'blur'
            }
          ],
          // zileimuType: [
          //   {
          //     required: true,
          //     message: '商品子类目没选择',
          //     trigger: 'blur'
          //   }
          // ],
          address: [
            {
              required: true,
              message: '工厂地址没填',
              trigger: 'blur'
            }
          ],
          goodsCType: [
            {
              required: true,
              message: '商品分类没选择',
              trigger: 'blur'
            }
          ],
          goodsDType: [
            {
              required: true,
              message: '商品类别没选择',
              trigger: 'blur'
            }
          ],
          color: [
            {
              required: true,
              message: '颜色没选择',
              trigger: 'blur'
            }
          ],
          sliderProcess: [
            {
              required: true,
              message: '拉头工艺没填写',
              trigger: 'blur'
            }
          ],
          productionProcess: [
            {
              required: true,
              message: '生产工艺没填写',
              trigger: 'blur'
            }
          ],
          rawYarn: [
            {
              required: true,
              message: '原料纱支没选择',
              trigger: 'blur'
            }
          ],
          glossiness: [
            {
              required: true,
              message: '光泽度没选择',
              trigger: 'blur'
            }
          ],
          material: [
            {
              required: true,
              message: '材质没选择',
              trigger: 'blur'
            }
          ],
          elasticDegree: [
            {
              required: true,
              message: '弹力程度没选择',
              trigger: 'blur'
            }
          ],
          widthClass: [
            {
              required: true,
              message: '宽度分类没选择',
              trigger: 'blur'
            }
          ],
          specificationModel: [
            {
              required: true,
              message: '规格型号没填写',
              trigger: 'blur'
            }
          ],
          cupThickness: [
            {
              required: true,
              message: '杯型厚度没选择',
              trigger: 'blur'
            }
          ],
          patchMaterial: [
            {
              required: true,
              message: '贴布材质没填写',
              trigger: 'blur'
            }
          ],
          wrapperMaterial: [
            {
              required: true,
              message: '包装材质没选择',
              trigger: 'blur'
            }
          ],
          buyType: [
            {
              required: true
            }
          ],
          weaveProcess: [
            {
              required: true
            }
          ]
        }
      }
    },
    computed: {
      ...mapState({
        userInfo: state => state.user.userInfo
      })
    },
    created() {
      const that = this
      const datas = {
        phone: that.userInfo.phone
      }
      getUserId(datas).then(response => {
        that.userId = response.data.data.id
      })
      // 获取商品类目标签
      const url = '/app/yykGoodsType/goodsTypeTree/0'
      queryShangPinLeiMu(url, {}).then(response => {
        that.GoodLeiMuList = response.data.data
      })
      const unitUrl = '/app/dict/unit'
      queryShangPinFenLei(unitUrl, {}).then(response => {
        that.priceUnitList = response.data.data
      })
      // 颜色列表
      const colorUrl = '/app/dict/color'
      queryShangPinFenLei(colorUrl, {}).then(response => {
        that.colorList = response.data.data
      })
      // 原料纱支
      const yuanliaoUrl = '/app/dict/fabric_raw_yarn'
      queryShangPinFenLei(yuanliaoUrl, {}).then(response => {
        that.yuanliaoList = response.data.data
      })
      // 光泽度
      const guangzeduUrl = '/app/dict/glossiness'
      queryShangPinFenLei(guangzeduUrl, {}).then(response => {
        that.guangzeduList = response.data.data
      })
      // 辅料材质
      const fuliaocaizhiUrl = '/app/dict/accessory_material'
      queryShangPinFenLei(fuliaocaizhiUrl, {}).then(response => {
        that.fuliaocaizhiList = response.data.data
      })
      // 弹力
      const tanliUrl = '/app/dict/elastic_degree'
      queryShangPinFenLei(tanliUrl, {}).then(response => {
        that.tanliList = response.data.data
      })
      // 宽度分类 kuandufeneleiList
      const kuandufenleiUrl = '/app/dict/width_class'
      queryShangPinFenLei(kuandufenleiUrl, {}).then(response => {
        that.kuandufeneleiList = response.data.data
      })
      // 杯型厚度 beixingList
      const beixingUrl = '/app/dict/cup_thickness'
      queryShangPinFenLei(beixingUrl, {}).then(response => {
        that.beixingList = response.data.data
      })
      // 包装材质 baozhuangList
      const baozhuangUrl = '/app/dict/wrapper_texture'
      queryShangPinFenLei(baozhuangUrl, {}).then(response => {
        that.baozhuangList = response.data.data
      })
    },
    methods: {
      // 图片上传
      handleAvatarSuccess(response) {
        this.form.topPicture = response.data
        // console.log(response)
      },
      handleUploadSuccess(response, file, fileList) {
        this.pictureList = fileList
      },
      // 图片删除
      handleRemove(file, fileList) {
        this.pictureList = fileList
      },
      handlePictureCardPreview(file) {
        this.dialogImageUrl = file.url
        this.dialogVisible = true
      },
      // 原料纱支改变
      chooseRawYarn(val) {
        const that = this
        if (val === '4') {
          that.qitaRawYarn = true
        } else {
          that.qitaRawYarn = false
        }
      },
      // 类目改变
      changeGoodLeiMu(val) {
        const that = this
        that.clearParam()
        that.form.btype = ''
        that.zileimuType = ''
        that.form.goodsCType = ''
        that.form.goodsDType = ''
        that.form.goodsDTypeweight = ''
        that.form.componentProportion = ''
        that.form.flowerSize = ''
        that.form.width = ''
        that.form.size = ''
        that.form.patchMaterial = ''
        that.form.pantoneNum = ''
        that.form.breadth = ''
        that.form.rubberContent = ''
        that.form.thickness = ''
        that.form.otherParam = ''
        that.form.flowerHigh = ''
        that.form.sliderProcess = ''
        that.form.specificationModel = ''
        that.form.productionProcess = ''
        that.form.glossiness = ''
        that.form.cupThickness = ''
        that.form.zipperType = ''
        that.form.material = ''
        that.form.widthClass = ''
        that.form.rawYarn = ''
        that.form.elasticDegree = ''
        that.form.wrapperMaterial = ''
        const url = '/app/yykGoodsType/goodsTypeTree' + '/' + val
        queryShangPinLeiMu(url, {}).then(response => {
          if (val === 1) {
            that.mianliaoShow = true
            that.buLiaoList = response.data.data
          } else {
            that.mianliaoShow = false
            that.childrenTypeList = response.data.data
            // 辅料
            if (val === 3) {
              const fuliaoFenLei = '/app/dict/accessory'
              queryShangPinFenLei(fuliaoFenLei, {}).then(response => {
                that.shangPinFenLeiList = response.data.data
              })
            }
            // 胸杯
            if (val === 4) {
              that.shengchanShow = true // 生产工艺
              that.leibieShow = true // 类别
              that.beixingShow = true // 杯型厚度
              that.qitaShow = true // 其他参数
              that.tiebuShow = true // 贴布材质
              that.kuandufenleiShow = false // 宽度分类
              that.fukuanShow = false // 幅宽
              that.huagaoShow = false// 花高
              that.caizhiShow = false // 材质
              that.kezhongShow = false// 克重
              that.tanliShow = false // 弹力
              that.guangzeShow = false // 光泽
              that.kuanduShow = false // 宽度
              that.yuanliaoShow = false // 原料纱支
              that.chengbenShow = false // 成分比例
              that.pantongShow = false // 潘通色号
              that.huaxingShow = false // 花型尺寸
              that.pantongShow = false // 潘通色号
              that.bianzhiShow = false // 编织工艺
              that.baozhuangShow = false // 包装材质
              that.guigecicunShow = false // 规格尺寸
              that.xinghaoShow = false // 规格型号
              that.chicunShow = false // 拉链尺寸
              that.hanjiaoShow = false // 含胶量
              that.houduShow = false // 厚度
              that.latouShow = false // 拉头工艺
              const fuliaoFenLei = '/app/dict/thoracic_cup'
              queryShangPinFenLei(fuliaoFenLei, {}).then(response => {
                that.shangPinFenLeiList = response.data.data
              })
            }
            // 扣类
            if (val === 6) {
              that.guigecicunShow = true // 规格尺寸
              that.qitaShow = true // 其他参数
              that.shengchanShow = false // 生产工艺
              that.leibieShow = false // 类别
              that.beixingShow = false // 杯型厚度
              that.tiebuShow = false // 贴布材质
              that.kuandufenleiShow = false // 宽度分类
              that.fukuanShow = false // 幅宽
              that.huagaoShow = false// 花高
              that.caizhiShow = false // 材质
              that.kezhongShow = false// 克重
              that.tanliShow = false // 弹力
              that.guangzeShow = false // 光泽
              that.kuanduShow = false // 宽度
              that.yuanliaoShow = false // 原料纱支
              that.chengbenShow = false // 成分比例
              that.pantongShow = false // 潘通色号
              that.huaxingShow = false // 花型尺寸
              that.pantongShow = false // 潘通色号
              that.bianzhiShow = false // 编织工艺
              that.baozhuangShow = false // 包装材质
              that.xinghaoShow = false // 规格型号
              that.chicunShow = false // 拉链尺寸
              that.hanjiaoShow = false // 含胶量
              that.houduShow = false // 厚度
              that.latouShow = false // 拉头工艺
              const fuliaoFenLei = '/app/dict/fastener_type'
              queryShangPinFenLei(fuliaoFenLei, {}).then(response => {
                that.shangPinFenLeiList = response.data.data
              })
            }
            // 包装材料
            if (val === 7) {
              that.guigecicunShow = true // 规格尺寸
              that.qitaShow = true // 其他参数
              that.baozhuangShow = true // 包装材质
              that.shengchanShow = false // 生产工艺
              that.leibieShow = false // 类别
              that.beixingShow = false // 杯型厚度
              that.tiebuShow = false // 贴布材质
              that.kuandufenleiShow = false // 宽度分类
              that.fukuanShow = false // 幅宽
              that.huagaoShow = false// 花高
              that.caizhiShow = false // 材质
              that.kezhongShow = false// 克重
              that.tanliShow = false // 弹力
              that.guangzeShow = false // 光泽
              that.kuanduShow = false // 宽度
              that.yuanliaoShow = false // 原料纱支
              that.chengbenShow = false // 成分比例
              that.pantongShow = false // 潘通色号
              that.huaxingShow = false // 花型尺寸
              that.pantongShow = false // 潘通色号
              that.bianzhiShow = false // 编织工艺
              that.xinghaoShow = false // 规格型号
              that.chicunShow = false // 拉链尺寸
              that.hanjiaoShow = false // 含胶量
              that.houduShow = false // 厚度
              that.latouShow = false // 拉头工艺
            }
            // 其他
            if (val === 8) {
              that.guigecicunShow = true // 规格尺寸
              that.qitaShow = true // 其他参数
              that.caizhiShow = false // 材质
              that.baozhuangShow = false // 包装材质
              that.shengchanShow = false // 生产工艺
              that.leibieShow = false // 类别
              that.beixingShow = false // 杯型厚度
              that.tiebuShow = false // 贴布材质
              that.kuandufenleiShow = false // 宽度分类
              that.fukuanShow = false // 幅宽
              that.huagaoShow = false// 花高
              that.kezhongShow = false// 克重
              that.tanliShow = false // 弹力
              that.guangzeShow = false // 光泽
              that.kuanduShow = false // 宽度
              that.yuanliaoShow = false // 原料纱支
              that.chengbenShow = false // 成分比例
              that.pantongShow = false // 潘通色号
              that.huaxingShow = false // 花型尺寸
              that.pantongShow = false // 潘通色号
              that.bianzhiShow = false // 编织工艺
              that.xinghaoShow = false // 规格型号
              that.chicunShow = false // 拉链尺寸
              that.hanjiaoShow = false // 含胶量
              that.houduShow = false // 厚度
              that.latouShow = false // 拉头工艺
              const fuliaoFenLei = '/app/dict/other_type'
              queryShangPinFenLei(fuliaoFenLei, {}).then(response => {
                that.shangPinFenLeiList = response.data.data
              })
            }
          }
        })
      },
      // 布料改变
      changeBuLiaoLeiMu(val) {
        const that = this
        that.clearParam()
        that.zileimuType = ''
        that.form.goodsCType = ''
        that.form.goodsDType = ''
        that.form.rawYarn = ''
        that.form.color = ''
        const url = '/app/yykGoodsType/goodsTypeTree' + '/' + val
        queryShangPinLeiMu(url, {}).then(response => {
          that.childrenTypeList = response.data.data
          that.form.btype = val
        })
        // 素色布
        if (val === 9) {
          that.form.goodsCType = ''
          that.form.color = ''
          that.bianzhiShow = true // 编织工艺
          that.pantongShow = true // 潘通色号
          that.kezhongShow = true // 克重
          that.yuanliaoShow = true // 原料纱支
          that.chengbenShow = true // 成分比例
          that.guangzeShow = true // 光泽
          that.fukuanShow = true // 幅宽
          that.baozhuangShow = false // 包装材质
          that.guigecicunShow = false // 规格尺寸
          that.tiebuShow = false // 贴布材质
          that.beixingShow = false // 杯型厚度
          that.xinghaoShow = false // 规格型号
          that.chicunShow = false // 拉链尺寸
          that.kuandufenleiShow = false // 宽度分类
          that.huagaoShow = false // 花高
          that.tanliShow = false // 弹力
          that.caizhiShow = false // 材质
          that.qitaShow = false // 其他参数
          that.hanjiaoShow = false // 含胶量
          that.houduShow = false // 厚度
          that.kuanduShow = false // 宽度
          that.huaxingShow = false // 花型尺寸
          that.shengchanShow = false // 生产工艺
          that.latouShow = false // 拉头工艺
          that.leibieShow = false // 类别
          that.gongChangDiZhiShow = false // 工厂地址展示
          const suseUrl = '/app/dict/shads_cloth'
          queryShangPinFenLei(suseUrl, {}).then(response => {
            that.shangPinFenLeiList = response.data.data
          })
        }
        // 印花
        if (val === 10) {
          that.bianzhiShow = true // 编织工艺
          that.leibieShow = true // 类别
          that.huaxingShow = true // 花型尺寸
          that.guangzeShow = true // 光泽
          that.kezhongShow = true // 克重
          that.yuanliaoShow = true // 原料纱支
          that.chengbenShow = true // 成分比例
          that.fukuanShow = true // 幅宽
          that.pantongShow = false // 潘通色号
          that.baozhuangShow = false // 包装材质
          that.guigecicunShow = false // 规格尺寸
          that.tiebuShow = false // 贴布材质
          that.beixingShow = false // 杯型厚度
          that.xinghaoShow = false // 规格型号
          that.chicunShow = false // 杯型厚度
          that.kuandufenleiShow = false // 宽度分类
          that.huagaoShow = false // 花高
          that.tanliShow = false // 弹力
          that.caizhiShow = false // 材质
          that.qitaShow = false // 其他参数
          that.hanjiaoShow = false // 含胶量
          that.houduShow = false // 厚度
          that.kuanduShow = false // 宽度
          that.shengchanShow = false // 生产工艺
          that.latouShow = false // 拉头工艺
          that.gongChangDiZhiShow = false // 工厂地址展示
          const yinhuaUrl = '/app/dict/print_face_cloth'
          queryShangPinFenLei(yinhuaUrl, {}).then(response => {
            that.shangPinFenLeiList = response.data.data
          })
          const libuLeiBieUrl = '/app/dict/printing_cloth_type'
          queryShangPinFenLei(libuLeiBieUrl, {}).then(response => {
            that.shangpinLieBieList = response.data.data
          })
        }
        // 提花
        if (val === 11) {
          that.bianzhiShow = true // 编织工艺
          that.guangzeShow = true // 光泽
          that.kezhongShow = true // 克重
          that.yuanliaoShow = true // 原料纱支
          that.chengbenShow = true // 成分比例
          that.fukuanShow = true // 幅宽
          that.pantongShow = true // 潘通色号
          that.huaxingShow = false // 花型尺寸
          that.pantongShow = false // 潘通色号
          that.baozhuangShow = false // 包装材质
          that.guigecicunShow = false // 规格尺寸
          that.leibieShow = false // 类别
          that.tiebuShow = false // 贴布材质
          that.beixingShow = false // 杯型厚度
          that.xinghaoShow = false // 规格型号
          that.chicunShow = false // 杯型厚度
          that.kuandufenleiShow = false // 宽度分类
          that.huagaoShow = false // 花高
          that.tanliShow = false // 弹力
          that.caizhiShow = false // 材质
          that.qitaShow = false // 其他参数
          that.hanjiaoShow = false // 含胶量
          that.houduShow = false // 厚度
          that.kuanduShow = false // 宽度
          that.shengchanShow = false // 生产工艺
          that.latouShow = false // 拉头工艺
          that.gongChangDiZhiShow = false // 工厂地址展示
          const tihuaUrl = '/app/dict/jacquard_face_cloth'
          queryShangPinFenLei(tihuaUrl, {}).then(response => {
            that.shangPinFenLeiList = response.data.data
          })
        }
        // 里布
        if (val === 2) {
          that.bianzhiShow = true // 编织工艺
          that.leibieShow = true // 类别
          that.guangzeShow = true // 光泽
          that.kezhongShow = true // 克重
          that.yuanliaoShow = true // 原料纱支
          that.chengbenShow = true // 成分比例
          that.fukuanShow = true // 幅宽
          that.pantongShow = true // 潘通色号
          that.huaxingShow = false // 花型尺寸
          that.pantongShow = false // 潘通色号
          that.baozhuangShow = false // 包装材质
          that.guigecicunShow = false // 规格尺寸
          that.tiebuShow = false // 贴布材质
          that.beixingShow = false // 杯型厚度
          that.xinghaoShow = false // 规格型号
          that.chicunShow = false // 拉链尺寸
          that.kuandufenleiShow = false // 宽度分类
          that.huagaoShow = false // 花高
          that.tanliShow = false // 弹力
          that.caizhiShow = false // 材质
          that.qitaShow = false // 其他参数
          that.hanjiaoShow = false // 含胶量
          that.houduShow = false // 厚度
          that.kuanduShow = false // 宽度
          that.shengchanShow = false // 生产工艺
          that.latouShow = false // 拉头工艺
          const libuUrl = '/app/dict/inside_cloth'
          queryShangPinFenLei(libuUrl, {}).then(response => {
            that.shangPinFenLeiList = response.data.data
          })
          const libuLeiBieUrl = '/app/dict/inside_cloth_type'
          queryShangPinFenLei(libuLeiBieUrl, {}).then(response => {
            that.shangpinLieBieList = response.data.data
          })
        }
      },
      // 商品子类目
      changeShangPinZiLeiMu(val) {
        const that = this
        that.form.goodsCType = ''
        that.form.goodsDType = ''
        if (that.form.atype === 1) {
          that.zileimuType = val
          that.form.ctype = that.zileimuType
        } else {
          that.clearParam()
          that.zileimuType = val
          that.form.ctype = ''
          that.form.btype = that.zileimuType
          // 工厂地址显隐
          if (that.form.atype === 7 && that.form.btype !== 24) {
            that.gongChangDiZhiShow = true
          } else {
            that.gongChangDiZhiShow = false
          }
          // 松紧带
          if (that.form.atype === 3 && val === 16) {
            that.leibieShow = true // 类别
            that.caizhiShow = true // 材质
            that.kuanduShow = true // 宽度
            that.tanliShow = true // 弹力
            that.qitaShow = true // 其他参数
            that.guangzeShow = false // 光泽
            that.kezhongShow = false // 克重
            that.yuanliaoShow = false // 原料纱支
            that.chengbenShow = false // 成分比例
            that.fukuanShow = false // 幅宽
            that.pantongShow = false // 潘通色号
            that.huaxingShow = false // 花型尺寸
            that.pantongShow = false // 潘通色号
            that.bianzhiShow = false // 编织工艺
            that.baozhuangShow = false // 包装材质
            that.guigecicunShow = false // 规格尺寸
            that.tiebuShow = false // 贴布材质
            that.beixingShow = false // 杯型厚度
            that.xinghaoShow = false // 规格型号
            that.chicunShow = false // 拉链尺寸
            that.kuandufenleiShow = false // 宽度分类
            that.huagaoShow = false // 花高
            that.hanjiaoShow = false // 含胶量
            that.houduShow = false // 厚度
            that.shengchanShow = false // 生产工艺
            that.latouShow = false // 拉头工艺
            const libuLeiBieUrl = '/app/dict/elastic_type'
            queryShangPinFenLei(libuLeiBieUrl, {}).then(response => {
              that.shangpinLieBieList = response.data.data
            })
          }
          // 花边
          if (that.form.atype === 3 && val === 17) {
            that.leibieShow = true // 类别
            that.kuandufenleiShow = true // 宽度分类
            that.fukuanShow = true // 幅宽
            that.huagaoShow = true// 花高
            that.caizhiShow = true // 材质
            that.kezhongShow = true// 克重
            that.tanliShow = true // 弹力
            that.qitaShow = false // 其他参数
            that.guangzeShow = false // 光泽
            that.kuanduShow = false // 宽度
            that.yuanliaoShow = false // 原料纱支
            that.chengbenShow = false // 成分比例
            that.pantongShow = false // 潘通色号
            that.huaxingShow = false // 花型尺寸
            that.pantongShow = false // 潘通色号
            that.bianzhiShow = false // 编织工艺
            that.baozhuangShow = false // 包装材质
            that.guigecicunShow = false // 规格尺寸
            that.tiebuShow = false // 贴布材质
            that.beixingShow = false // 杯型厚度
            that.xinghaoShow = false // 规格型号
            that.chicunShow = false // 拉链尺寸
            that.hanjiaoShow = false // 含胶量
            that.houduShow = false // 厚度
            that.shengchanShow = false // 生产工艺
            that.latouShow = false // 拉头工艺
            const libuLeiBieUrl = '/app/dict/lace_type'
            queryShangPinFenLei(libuLeiBieUrl, {}).then(response => {
              that.shangpinLieBieList = response.data.data
            })
          }
          // 织带
          if (that.form.atype === 3 && val === 18) {
            that.leibieShow = true // 类别
            that.kuanduShow = true // 宽度
            that.caizhiShow = true // 材质
            that.tanliShow = true // 弹力
            that.qitaShow = true // 其他参数
            that.kezhongShow = false// 克重
            that.guangzeShow = false // 光泽
            that.fukuanShow = false // 幅宽
            that.huagaoShow = false// 花高
            that.kuandufenleiShow = false // 宽度分类
            that.yuanliaoShow = false // 原料纱支
            that.chengbenShow = false // 成分比例
            that.pantongShow = false // 潘通色号
            that.huaxingShow = false // 花型尺寸
            that.pantongShow = false // 潘通色号
            that.bianzhiShow = false // 编织工艺
            that.baozhuangShow = false // 包装材质
            that.guigecicunShow = false // 规格尺寸
            that.tiebuShow = false // 贴布材质
            that.beixingShow = false // 杯型厚度
            that.xinghaoShow = false // 规格型号
            that.chicunShow = false // 拉链尺寸
            that.hanjiaoShow = false // 含胶量
            that.houduShow = false // 厚度
            that.shengchanShow = false // 生产工艺
            that.latouShow = false // 拉头工艺
            const libuLeiBieUrl = '/app/dict/ribbon_type'
            queryShangPinFenLei(libuLeiBieUrl, {}).then(response => {
              that.shangpinLieBieList = response.data.data
            })
          }
          // 拉链
          if (that.form.atype === 3 && val === 20) {
            that.leibieShow = true // 类别
            that.chicunShow = true // 拉链尺寸
            that.caizhiShow = true // 材质
            that.latouShow = true // 拉头工艺
            that.qitaShow = true // 其他参数
            that.tanliShow = false // 弹力
            that.kezhongShow = false// 克重
            that.guangzeShow = false // 光泽
            that.fukuanShow = false // 幅宽
            that.kuanduShow = false // 宽度
            that.huagaoShow = false// 花高
            that.kuandufenleiShow = false // 宽度分类
            that.yuanliaoShow = false // 原料纱支
            that.chengbenShow = false // 成分比例
            that.pantongShow = false // 潘通色号
            that.huaxingShow = false // 花型尺寸
            that.pantongShow = false // 潘通色号
            that.bianzhiShow = false // 编织工艺
            that.baozhuangShow = false // 包装材质
            that.guigecicunShow = false // 规格尺寸
            that.tiebuShow = false // 贴布材质
            that.beixingShow = false // 杯型厚度
            that.xinghaoShow = false // 规格型号
            that.hanjiaoShow = false // 含胶量
            that.houduShow = false // 厚度
            that.shengchanShow = false // 生产工艺
            const libuLeiBieUrl = '/app/dict/zipper_type'
            queryShangPinFenLei(libuLeiBieUrl, {}).then(response => {
              that.shangpinLieBieList = response.data.data
            })
          }
          // 其他
          if (that.form.atype === 3 && val === 21) {
            that.xinghaoShow = true // 规格型号
            that.caizhiShow = true // 材质
            that.qitaShow = true // 其他参数
            that.tanliShow = true // 弹力
            that.latouShow = false // 拉头工艺
            that.chicunShow = false // 拉链尺寸
            that.leibieShow = false // 类别
            that.kezhongShow = false// 克重
            that.guangzeShow = false // 光泽
            that.fukuanShow = false // 幅宽
            that.kuanduShow = false // 宽度
            that.huagaoShow = false// 花高
            that.kuandufenleiShow = false // 宽度分类
            that.yuanliaoShow = false // 原料纱支
            that.chengbenShow = false // 成分比例
            that.pantongShow = false // 潘通色号
            that.huaxingShow = false // 花型尺寸
            that.pantongShow = false // 潘通色号
            that.bianzhiShow = false // 编织工艺
            that.baozhuangShow = false // 包装材质
            that.guigecicunShow = false // 规格尺寸
            that.tiebuShow = false // 贴布材质
            that.beixingShow = false // 杯型厚度
            that.hanjiaoShow = false // 含胶量
            that.houduShow = false // 厚度
            that.shengchanShow = false // 生产工艺
            const libuLeiBieUrl = '/app/dict/lace_type'
            queryShangPinFenLei(libuLeiBieUrl, {}).then(response => {
              that.shangpinLieBieList = response.data.data
            })
          }
          // 橡皮
          if (that.form.atype === 3 && val === 47) {
            that.hanjiaoShow = true // 含胶量
            that.kuanduShow = true // 宽度
            that.houduShow = true // 厚度
            that.qitaShow = true // 其他参数
            that.tanliShow = false // 弹力
            that.caizhiShow = false // 材质
            that.latouShow = false // 拉头工艺
            that.xinghaoShow = false // 规格型号
            that.chicunShow = false // 拉链尺寸
            that.leibieShow = false // 类别
            that.kezhongShow = false// 克重
            that.guangzeShow = false // 光泽
            that.fukuanShow = false // 幅宽
            that.huagaoShow = false// 花高
            that.kuandufenleiShow = false // 宽度分类
            that.yuanliaoShow = false // 原料纱支
            that.chengbenShow = false // 成分比例
            that.pantongShow = false // 潘通色号
            that.huaxingShow = false // 花型尺寸
            that.pantongShow = false // 潘通色号
            that.bianzhiShow = false // 编织工艺
            that.baozhuangShow = false // 包装材质
            that.guigecicunShow = false // 规格尺寸
            that.tiebuShow = false // 贴布材质
            that.beixingShow = false // 杯型厚度
            that.shengchanShow = false // 生产工艺
          }
          // 胸杯 胸杯
          if (that.form.atype === 4 && val === 45) {
            const libuLeiBieUrl = '/app/dict/thoracic_cup_type'
            queryShangPinFenLei(libuLeiBieUrl, {}).then(response => {
              that.shangpinLieBieList = response.data.data
            })
          }
          // 胸杯 - 钢圈
          if (that.form.atype === 4 && val === 49) {
            const gangquanUrl = '/app/dict/steel_rim'
            queryShangPinFenLei(gangquanUrl, {}).then(response => {
              that.shangpinLieBieList = response.data.data
            })
          }
          // 胸杯 - 杯垫
          if (that.form.atype === 4 && val === 50) {
            const gangquanUrl = '/app/dict/thoracic_cup_coaster'
            queryShangPinFenLei(gangquanUrl, {}).then(response => {
              that.shangpinLieBieList = response.data.data
            })
          }
          // 包装材料-衣架
          if (that.form.atype === 7 && val === 24) {
            const gangquanUrl = '/app/dict/wrapper_hanger'
            queryShangPinFenLei(gangquanUrl, {}).then(response => {
              that.shangPinFenLeiList = response.data.data
            })
          }
          // 包装材料-商标
          if (that.form.atype === 7 && val === 25) {
            const gangquanUrl = '/app/dict/wrapper_trademark'
            queryShangPinFenLei(gangquanUrl, {}).then(response => {
              that.shangPinFenLeiList = response.data.data
            })
          }
          // 包装材料-吊牌
          if (that.form.atype === 7 && val === 26) {
            const gangquanUrl = '/app/dict/wrapper_tag'
            queryShangPinFenLei(gangquanUrl, {}).then(response => {
              that.shangPinFenLeiList = response.data.data
            })
          }
          // 包装材料-塑料袋
          if (that.form.atype === 7 && val === 27) {
            const gangquanUrl = '/app/dict/wrapper_plastic_bag'
            queryShangPinFenLei(gangquanUrl, {}).then(response => {
              that.shangPinFenLeiList = response.data.data
            })
          }
          // 包装材料-裆贴
          if (that.form.atype === 7 && val === 28) {
            const gangquanUrl = '/app/dict/wrapper_paper'
            queryShangPinFenLei(gangquanUrl, {}).then(response => {
              that.shangPinFenLeiList = response.data.data
            })
          }
          // 包装材料-纸箱
          if (that.form.atype === 7 && val === 29) {
            const gangquanUrl = '/app/dict/wrapper_carton'
            queryShangPinFenLei(gangquanUrl, {}).then(response => {
              that.shangPinFenLeiList = response.data.data
            })
          }
        }
      },
      clearParam() {
        const that = this
        that.form.btype = ''
        that.zileimuType = ''
        that.form.goodsCType = ''
        that.form.goodsDType = ''
        that.form.goodsDTypeweight = ''
        that.form.componentProportion = ''
        that.form.flowerSize = ''
        that.form.width = ''
        that.form.size = ''
        that.form.patchMaterial = ''
        that.form.pantoneNum = ''
        that.form.breadth = ''
        that.form.rubberContent = ''
        that.form.thickness = ''
        that.form.otherParam = ''
        that.form.flowerHigh = ''
        that.form.sliderProcess = ''
        that.form.specificationModel = ''
        that.form.productionProcess = ''
        that.form.glossiness = ''
        that.form.cupThickness = ''
        that.form.zipperType = ''
        that.form.material = ''
        that.form.widthClass = ''
        that.form.rawYarn = ''
        that.form.elasticDegree = ''
        that.form.wrapperMaterial = ''
      },
      // 进行发布
      publishGood() {
        const that = this
        // that.form.topPicture = that.pictureList[0].response.data
        that.$refs['form'].validate((valid) => {
          if (valid) {
            if (that.pictureList.length < 1) {
              that.$message.error('请上传商品图片信息')
              return
            }
            const allparams = {
              goodsName: that.form.goodsName,
              goodsNo: that.form.goodsNo,
              topPicture: that.form.topPicture,
              price: that.form.price,
              discountPrice: that.form.discountPrice,
              priceUnit: that.form.priceUnit,
              describe: that.form.describe,
              address: that.form.address,
              inventory: that.form.inventory,
              atype: that.form.atype,
              btype: that.form.btype,
              ctype: that.form.ctype,
              artNo: that.form.artNo,
              color: that.form.color,
              describeInfo: that.form.describeInfo,
              parameter: {
                goodsCType: that.form.goodsCType,
                goodsDType: that.form.goodsDType,
                weight: that.form.weight,
                componentProportion: that.form.componentProportion,
                flowerSize: that.form.flowerSize,
                width: that.form.width,
                size: that.form.size,
                otherRawYarn: that.form.otherRawYarn,
                patchMaterial: that.form.patchMaterial,
                weaveProcess: that.bianzhiShow ? that.form.weaveProcess : '',
                pantoneNum: that.form.pantoneNum,
                breadth: that.form.breadth,
                rubberContent: that.form.rubberContent,
                thickness: that.form.thickness,
                otherParam: that.form.otherParam,
                flowerHigh: that.form.flowerHigh,
                sliderProcess: that.form.sliderProcess,
                specificationModel: that.form.specificationModel,
                productionProcess: that.form.productionProcess,
                glossiness: that.form.glossiness,
                cupThickness: that.form.cupThickness,
                zipperType: that.form.zipperType,
                material: that.form.material,
                widthClass: that.form.widthClass,
                buyType: that.form.buyType,
                rawYarn: that.form.rawYarn,
                elasticDegree: that.form.elasticDegree,
                wrapperMaterial: that.form.wrapperMaterial
              }
            }
            let str = ''
            that.pictureList.forEach((item, index) => {
              str += (item.response.data + ',')
            })
            if (str.length > 0) {
              str = str.substring(0, str.length - 1)
            }
            allparams.detailImgs = str
            const publishUrl = '/app/yykGoods/save'
            allparams.userId = that.userId
            publishGood(publishUrl, allparams).then(response => {
              if (response.data.code === '0') {
                that.$message({
                  message: '发布成功',
                  type: 'success'
                })
                that.$router.go(0)
              }
            })
          }
        })
      }
    }
  }
</script>
<style>
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
</style>
<style scoped>
  .title{
    font-weight: bold;
    font-size: 24px;
  }

  .el-input {
    position: relative;
    font-size: 14px;
    display: inline-block;
    width: 50%
  }
  .el-form {
    margin-left: 36px;
  }
  .is-disabled{
    background-color: #fff;
  }
  .inputRow input{
    background-color: #fff !important;
  }
  .el-input__inner{
    background-color: #fff !important;
  }
  .el-input__inner{
    background-color: #fff !important;
  }
  .textareaCon{
    width: 60%;
    height: 200px;
    border: 1px solid #f5f5f5;
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 15px;
  }
  .imgContent{
    width: 60%;
    border: 1px solid #f5f5f5;
    padding: 5px;
  }
  .picContent{
    width: 100%;
  }
  .el-select {
    width: 50% !important;
  }
  .el-textarea__inner{
    border-color: #c0c4cc;
    border-radius: 20px;
    height:200px !important;
  }
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
    border: 1px solid #8c939d
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
  .btn{
    margin-top: 60px;
    margin-bottom: 10px;
    width: 300px;
    height: 60px;
    color: #fff;
    font-weight: bold;
    font-size: 20px;
    line-height: 60px;
    text-align: center;
    background-color: #169BD5;
    margin-left: 110px;
    border-radius: 10px
  }
  .specialText{
    display: block;
  }
  .detailContent{
    width: 50%;
    border: 1px solid #c0c4cc;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 8px;
  }
  .call {
    margin-bottom: 22px;
    padding-left: 120px;
    /*font-size: 14px;*/
    color: #606266;
    line-height: 40px;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatars {
    display: block;
    width: 178px;
    height: 178px;
  }
</style>
